﻿using Microsoft.AspNetCore.Mvc;

namespace PageOffice6_Net_Core.Controllers.InsertImageSetSize
{
    public class InsertImageSetSizeController : Controller
    {
        public IActionResult Word()
        {
            PageOfficeNetCore.PageOfficeCtrl poCtrl = new PageOfficeNetCore.PageOfficeCtrl(Request);

            PageOfficeNetCore.Word.WordDocumentWriter doc = new PageOfficeNetCore.Word.WordDocumentWriter();
            PageOfficeNetCore.Word.DataRegionWriter data1 = doc.OpenDataRegion("PO_p1");
            data1.Value = "[image width=200.2 height=200]/InsertImageSetSize/doc/1.jpg[/image]";
            poCtrl.SetWriter(doc);

            //打开Word文档
            poCtrl.WebOpen("doc/test.doc", PageOfficeNetCore.OpenModeType.docNormalEdit, "tom");
            ViewBag.poCtrl = poCtrl.GetHtml();
            return View();
        }
    }
}